<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:p="http://primefaces.org/ui"
	lang="en">
	
	<ui:decorate template="/WEB-INF/facelets/faceletEditar.xhtml">
		<ui:define name="form">
			<h:form styleClass="form-horizontal">
				
				<p:messages id="mensagens"></p:messages>	
				
				<fieldset>
					<legend>Lançamento de Pagamentos de Compra</legend>
					<div class="control-group">
					
						<div style="padding-bottom: 3px;">
							<h:outputLabel value="Data:" for="data" styleClass="control-label" />
							<p:calendar id="data" value="#{PagamentoCompraMB.entidade.data}" pattern="dd/MM/yyyy">
							</p:calendar>
						</div>
						<br />
						
						<h:outputLabel value="Valor:" for="valor" styleClass="control-label" />
						<h:inputText id="valor" value="#{PagamentoCompraMB.entidade.valor}" styleClass="span3" maxlength="50" converter="javax.faces.BigDecimal"/>
						<br />
						
						<div style="padding-bottom: 3px;">
							<h:outputLabel value="Descrição:" for="descricao" styleClass="control-label" />
							<h:inputTextarea id="descricao" value="#{PagamentoCompraMB.entidade.descricao}" cols="50" rows="4"></h:inputTextarea>
						</div>
						<br />
						
						<div class="span12">
						
							<p:commandButton 
								value="Gravar" 
								action="#{PagamentoCompraMB.gravar}"
								styleClass="btn btn-inverse"
								update="mensagens"/>
							<span></span>
							
							<p:commandButton 
								value="Excluir" 
								action="#{PagamentoCompraMB.excluir}"
								styleClass="btn btn-inverse"
								rendered="#{PagamentoCompraMB.exibirExcluir}"
								onclick="confirmation.show()" 
								type="button">
							</p:commandButton>
							
							<p:confirmDialog 
								id="confirmDialog" 
								message="Confimar a exclusão do registro?"  
					            header="Confirmação!" 
					            severity="alert" 
					            widgetVar="confirmation">  
					                  
					        <p:commandButton 
					        	id="confirm" 
					        	value="Sim" 
					        	oncomplete="confirmation.hide()"  
					            action="#{PagamentoCompraMB.excluir}"/>  
					        
					        <p:commandButton 
					        	id="decline" 
					        	value="Não" 
					        	onclick="confirmation.hide()" 
					        	type="button" />   
					                  
					    	</p:confirmDialog>  
						</div>
					</div>
				</fieldset>
			</h:form>
		</ui:define>
	</ui:decorate>
</html>